package designMode.statePattern.after;

/**
 * @author LIBOFEI
 * @ClassName NoQuarterState
 * @description
 * @date 2020/6/28 16:50
 * @Version 1.0
 **/
public class NoQuarterState implements State {

    GumballMachine gumballMachine;

    public NoQuarterState(GumballMachine gumballMachine){
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("投币成功");
        gumballMachine.setState(gumballMachine.getHasQuarterState());
    }

    @Override
    public void ejectQuarter() {
        System.out.println("您还没有投币");
    }

    @Override
    public void turnCrank() {
        System.out.println("您还没有投币");
    }

    @Override
    public void dispense() {
        System.out.println("您还没有投币");
    }
}
